The appearance and layout of a typical text document, e.g., a word processing document or a media presentation document, is determined by the selection of fonts used to display the characters which comprise the text document. To accurately render a text document, often it is necessary to vary the size or resolution of the font, depending on the display or printer used to view the contents of the document.
Mathematical algorithms are used to scale font characters and render the font characters at various sizes and resolutions. One mathematical scheme used to render font characters at various sizes and resolutions while maintaining character aesthetics is referred to as hinting. Hinting corrects the pixels of a font character scaled to a given size and resolution using any number of techniques for restoring the native shape, aesthetics and legibility of the character. Hinting consists of making minor corrections to the outline of a font character to preserve the “spirit” of a typeface throughout all of its characters or glyphs for all font sizes.
One type or family of fonts, which are mathematically scalable, are TrueType fonts. Other scalable fonts include PostScript, TrueType or OpenType font. In TrueType fonts, each glyph or character form contains a respective hint data program, such as a script or algorithm, which includes instructions for manipulating various control points of the respective glyph outline just prior to rasterization. As a result, the outline of the glyph is mathematically altered by the respective glyph's hinting instruction to surround only the pixels that produce a desired bitmap image of the glyph.
Typically, the outline and hint data are executed using a hint instruction processing program which interprets hint instructions that are embedded within each character in a TrueType font set. The hinting program is typically written in C programming language, which recognizes on the order of 256 hinting instructions. Many of these instructions move two dimensional coordinates of a point either horizontally, vertically or in a diagonal direction, called the “freedom vector.” Some instructions calculate the distance between points. Some interpolate collections of points between two moved points. The TrueType hint program inspects each hint instruction in the glyph and performs the operation specified by the hint instruction. PostScript uses a similar hint interpreter and hinting scheme.
Often it is necessary to adjust the height of text to fit within a fixed space. However, sometimes the characters which comprise the text are too tall to fit within a fixed space and, therefore, the characters need to be adjusted in a vertical or y direction. This could be achieved by scaling the characters linearly in the y direction. One disadvantage with using linear scaling is that depending on the character and the extent to which the character height is to be reduced, the scaling produces characters which are distorted or do not appear correctly. Moreover, linear scaling may produce characters which affect readability.